import useRequest from "@/api/useRequest"
import {IPage} from "@/interface/modules/system";
export class characterInfoController {

  static syncData(): Promise<any> {
    return useRequest({
      url: "/characterInfo/syncDate",
      method: "get"
    })
  }

  static uploadToTuchuang(characterId: string): Promise<any> {
    return useRequest({
      url: "/characterInfo/uploadToTuchuang?characterId="+characterId,
      method: "get"
    })
  }

  static addCharacterInfo(data:any): Promise<any> {
    return useRequest({
      url: "/characterInfo/addOrUpdateCharacterInfo",
      method: "post",
      data
    })
  }

  static getCharacterInfoList(data:any, pagination?: IPage): Promise<any> {
    return useRequest({
      url: "/characterInfo/getCharacterInfoList",
      method: "post",
      params: pagination,
      data
    })
  }

  static updateCharacterInfo(data:any): Promise<any> {
    return useRequest({
      url: "/characterInfo/addOrUpdateCharacterInfo",
      method: "post",
      data
    })
  }

  static saveAvatar(data:any): Promise<any> {
      return useRequest({
          url: "/characterInfo/updateAvatar",
          method: "post",
          data
      })
  }

  static deleteCharacterInfo(id:string): Promise<any> {
      return useRequest({
          url: "/characterInfo/deleteCharacterInfo?id="+id,
          method: "get"
      })
  }

  static uploadToDiscord(id:string): Promise<any> {
      return useRequest({
          url: "/characterInfo/uploadToDiscord/"+id,
          method: "get"
      })
  }

  static interrogateImage(data:any):Promise<any>{
    return useRequest({
      url: "/characterInfo/interrogateImage",
      method: 'post',
      data
    })
  }
}
